﻿// -------------------------------------------------------------------------
//    @FileName         :    NFBaseDefine.h
//    @Author           :    gaoyi
//    @Date             :    24-8-13
//    @Email            :    445267987@qq.com
//    @Module           :    NFBaseDefine
//
// -------------------------------------------------------------------------

#pragma once

#include "proto_common_attr.pb.h"
#include "proto_cs_cmd.pb.h"
#include "NFComm/NFObjCommon/NFShmMgr.h"

enum enTableID
{
    E_TABLE_NONE = 0,
    E_TABLE_ROLE_LIST = 1,
    E_TABLE_NAME = 2,
    E_TABLE_ROLE_DETAIL = 3,
    E_TABLE_SNS_ROLE_SIMPLE = 4,
    E_TABLE_SNS_ROLE_DETAIL = 5,
};

struct CSMsgHead
{
    CSMsgHead()
    {
        if (NFShmMgr::Instance()->GetCreateMode() == EN_OBJ_MODE_INIT)
        {
            CreateInit();
        }
        else
        {
            ResumeInit();
        }
    }

    CSMsgHead(proto_ff::Proto_CS_CMD iMsgID, int32_t iSeqCS) : m_iMsgID(iMsgID), m_iSeqCS(iSeqCS)
    {
    }

    int CreateInit()
    {
        m_iMsgID = proto_ff::E_CS_CMD_NONE;
        m_iSeqCS = 0;
        return 0;
    }

    int ResumeInit()
    {
        return 0;
    }

    proto_ff::Proto_CS_CMD m_iMsgID; //client req msg id
    int32_t m_iSeqCS; //packet seq
};

typedef struct tagClientVesion
{
    int32_t m_iBigVer;
    int32_t m_iMidVer;
    int32_t m_iMinVer;
    int32_t m_iBuildCnt;
} TClientVersion;


struct TClientVersionConfig
{
    TClientVersion m_stMinVer;
    bool m_bMaxVerLimit;
    TClientVersion m_stMaxVer;
    TClientVersion m_stMinResVer;
    bool m_bMaxResVerLimit;
    TClientVersion m_stMaxResVer;
};

TClientVersion ParseClientVersion(const std::string& strClientVersion);

int CompareClientVersion(TClientVersion& stLeftVer, TClientVersion& stRightVer);

enum
{
    MAX_BUFF_DESC_RECORD_NUM = 8000,
    MAX_BUFF_DESC_ID_VALUE = 500000,
    MAX_BUFFLIB_DESC_RECORD_NUM = 200,
    MAX_BUFFLIB_DESC_ID_VALUE = 3000,
    MAX_HERO_DESC_RECORD_NUM = 100,
    MAX_HERO_DESC_ID_VALUE = 2000,
    MAX_LEVEL_DESC_RECORD_NUM = 2200,
    MAX_MAP_DESC_ID_VALUE = 3750,
    MAX_ACTOR_DESC_ID_VALUE = 50000,
    MAX_PLAYER_DESC_ID_VALUE = 5000,
    MAX_SKILL_DESC_RECORD_NUM = 20000,
    MAX_SKILL_DESC_ID_VALUE = 3000000,
    SKILL_DEFAULT_LEVEL = 1,
    MAX_ITEM_DESC_TYPE = 16,
    MAX_ITEM_DESC_SUB_TYPE = 38,
    MAX_ITEM_DESC_RANK = 10,
    MAX_EQUIP_TYPE = 30,
    MAX_EQUIP_STRENGTH_LEVEL = 32,
    MAX_EQUIP_DESC_RECORD_NUM = 16384,
    MAX_EQUIP_SKILL_SET_DESC_NUM = 1000,
    MAX_PASSIVE_SKILL_DESC_NUM = 10000,
    MAX_AISTRATEGY_DESC_ID_VALUE = 1000,
    MAX_AISTRATEGY_DESC_NUM = 1000,
    MAX_AIMACRO_DESC_NUM = 1000,
    MAX_PRIVATEMSG_DESC_NUM = 100,
    MAX_AISTRENGTH_DESC_NUM = 10,
    MAX_PLAYER_LEVEL_DESC = 152,
    MAX_HERO_LEVEL_DESC = 256,
    MAX_SCENE_TRIGGER_DESC_NUM = 1024,
    MAX_SCENE_TRIGGER_DESC_ID_VALUE = 2000,
    MAX_MALLDATA_DESC_NUM = 1000,
    MAX_MAIL_DESC_NUM = 1000,
    MAX_MAIL_DESC_ID_VALUE = 1000,
    MAX_GUILD_DESC_NUM = 50,
    MAX_GUILD_SEQUENCE_ID_NUM = 1000,
    MAX_GUILD_ARCHITECTURE_DESC_NUM = 50,
    MAX_GUILD_ARCHITECTURE_MAX_LV = 10,
    MAX_GUILD_DESC_ID_VALUE = 50,
    MAX_GUILDTECH_DESC_NUM = 100,
    MAX_GUILDEVENTSHARE_DESC_NUM = 100,

    MAX_GUILDACTIVITY_DESC_NUM = 10,
    MAX_GUILDTECH_DESC_ID_VALUE = 100,
    MAX_GUILDACTIVITY_DESC_ID_VALUE = 100,
    MAX_GUILDSHOP_DESC_NUM = 100,
    MAX_CONST_DESC_NUM = 1000,
    MAX_GUILDSHOP_DESC_ID_VALUE = 100,
    MAX_MALLDATA_DESC_ID_VALUE = 1000,
    MAX_PACKDATA_DESC_NUM = 1000,
    MAX_PACKDATA_DESC_ID_VALUE = 1000,
    MAX_SYSMSG_DESC_ID_VALUE = 1000,
    MAX_SYSMSG_DESC_RECORD_NUM = 1000,
    MAX_SYSADDRESS_DESC_ID_VALUE = 1000,
    MAX_SYSADDRESS_DESC_RECORD_NUM = 1000,
    MAX_ACTOR_DESC_NUM = 3000,
    MAX_FRIEND_RECOMMEND_DESC_NUM = 100,
    MAX_PLAYER_DESC_NUM = 100,
    MAX_RUNE_DESC_NUM = 500,
    MAX_RUNE_MERGE_DESC_NUM = 100,
    MAX_RUNE_DESC_ID_VALUE = 10000000,
    MAX_RUNE_PLATE_DESC_NUM = 50,
    MAX_RUNE_SHAPE_DESC_NUM = 100,
    MAX_RUNE_SHAPE_DESC_ID = 1000,
    MAX_RUNE_SHAPE_LIB_DESC_NUM = 200,
    MAX_RUNE_ATTR_DESC_NUM = 500,
    MAX_RUNE_ATTR_DESC_ID = 100000,
    MAX_JOB_DESC_NUM = 100,
    MAX_JOB_DESC_ID_VALUE = 10000,
    MAX_TALENT_DESC_ID_VALUE = 30000,
    MAX_TALENT_DESC_NUM = 1000,
    MAX_TRADE_DESC_NUM = 1000,
    MAX_SCENEDROPOBJ_DESC_NUM = 1000,
    MAX_SHOPLIB_DESC_NUM = 1000,
    MAX_SHOPLIB_DESC_ID_VALUE = 1000,
    MAX_TRADE_DESC_ID_VALUE = 1000,
    MAX_SCENEDROPOBJ_DESC_ID_VALUE = 10000,
    MAX_TRADE_LABEL = 10,
    MAX_BATTLE_BROADCAST_ID_VALUE = 500,
    MAX_BATTLE_BROADCAST_DESC_NUM = 200,
    MAX_LEVEL_GROUP_ID_VALUE = 1000,
    MAX_LEVEL_GROUP_DESC_NUM = 100,
    MAX_LEVEL_EVENT_ID_VALUE = 5000,
    MAX_LEVEL_EVENT_DESC_NUM = 500,
    MAX_CHARPTER_DESC_ID_VALUE = 2048,
    MAX_CHARPTER_DESC_NUM = 200,
    MAX_CHAMBER_DESC_ID_VALUE = 2048,
    MAX_CHAMBER_DESC_NUM = 200,
    MAX_NIANPRACTICEBONUS_DESC_ID_VALUE = 6000,
    MAX_NIANPRACTICEBONUS_DESC_NUM = 6000,
    MAX_NIANPRACTICE_DESC_NUM = 1000,
    MAX_EVENT_CONTROL_DESC_RECORD_NUM = 500,
    MAX_EVENT_CONTROL_DESC_ID_VALUE = 1000,
    MAX_AVATAR_DESC_ID_VALUE = 256,
    MAX_AVATAR_DESC_NUM = 256,
    MAX_GEMSTONE_DESC_ID_VALUE = 50000,
    MAX_GEMSTONE_DESC_NUM = 2000,
    MAX_GEMSTONE_QUALITY_VALUE = 20,
    MAX_GEMSTONE_PER_QUALITY_NUM = 100,
    MAX_GEMSTONE_SUIT_DESC_NUM = 200,
    MAX_GEMSTONE_SUIT_DESC_ID_VALUE = 400,
    MAX_GEMSTONE_SUIT_TYPE_VALUE = 12,
    MAX_GEMSTONE_SUIT_NUM_PER_TYPE = 6,
    MAX_GEMSTONE_SLOT_NUM = 4,
    MAX_PartnerEquipSTONE_SLOT_NUM = 4,
    MAX_SKILL_BIND_ID_VALUE = 100000,
    MAX_SKILL_HIT_ID_VALUE = 100000,
    MAX_SKILL_EFFECT_DESC_NUM = 3000,
    HITID_MOD = 10000,
    HITPHASE_MOD = 100,
    MAX_SKILL_HITID_NUM = 10,
    MAX_RANDNAME_DESC_NUM = 1000,
    MAX_RANDNAME_ID_VALUE = 100000,
    MAX_HERO_RANK_UP_DESC_RECORD_NUM = 500,
    MAX_HERO_RANK_UP_DESC_ID_VALUE = 1000,
    MIN_HERO_ID = 1000,
    MAX_HERO_ID = 1200,
    MAX_HERO_RANK = 10,
    MAX_OPENTIME_DESC_ID_VALUE = 100,
    MAX_OPENTIME_DESC_NUM = 100,
    MAX_HERO_PIECE_SUPPORT_DESC_NUM = 100,
    MAX_TREASURE_TRADE_DESC_NUM = 1000,
    MAX_QUESTION_DESC_ID_VALUE = 20000,
    MAX_QUESTION_REWARD_DESC_ID_VALUE = 2000,
    MAX_EXAMINER_ID_VALUE = 100,
    MAX_BRIBERY_COUNT_VALUE = 100,
    MAX_MSG_COUNT = 2000,
    MAX_MSG_ID_VALUE = 2000,
    MAX_PLEDGE_DESC_RECORD_NUM = 50,
    MAX_PLEDGE_DESC_ID_VALUE = 100,
    MAX_PLEDGE_SHOP_DESC_RECORD_NUM = 200,
    MAX_PLEDGE_SHOP_DESC_ID_VALUE = 400,
    MAX_CITY_MAP_DESC_RECORD_NUM = 100,
    MAX_CITY_MAP_DESC_ID = 200,
    MAX_FUNCTION_NPC_DESC_ID = 10000,
    MAX_FUNCTION_NPC_DESC_RECORD_NUM = 2000,
    MAX_PARTNER_DESC_RECORD_NUM = 70, //修改时需要同步修改 角色的伙伴列表数量
    MAX_PARTNER_DESC_ID_VALUE = 2000,
    MAX_PARTNER_RANK_DESC_RECORD_NUM = 10,
    MAX_PARTNER_RANK_DESC_ID_VALUE = 10,
    MAX_PARTNER_LEVEL_UP_DESC_RECORD_NUM = 200,
    MAX_PARTNER_LEVEL_UP_DESC_ID_VALUE = 200,
    MAX_PARTNER_OPEN_HOLE_DESC_RECORD_NUM = 20,
    MAX_PARTNER_OPEN_HOLE_DESC_ID_VALUE = 20,
    MAX_PARTNER_PASSIVE_SKILL_DESC_RECORD_NUM = 1000,
    MAX_PARTNER_PASSIVE_SKILL_DESC_ID_VALUE = 2000,
    MIN_PARTNER_PASSIVE_SKILL_ID = 1000,
    MAX_PARTNER_PASSIVE_SKILL_ID = 2000,
    MAX_PARTNER_PASSIVE_SKILL_LEVEL = 10,
    MAX_PARTNER_RANK_UP_DESC_RECORD_NUM = 10,
    MAX_PARTNER_RANK_UP_DESC_ID_VALUE = 10,
    MAX_PARTNER_CALCULATE_DESC_RECORD_NUM = 10,
    MAX_PARTNER_CALCULATE_DESC_ID_VALUE = 10,
    MAX_TEAM_PLATFORM_DESC_ID_VALUE = 400,
    MAX_TEAM_PLATFORM_DESC_RECORD_NUM = 400,
    MAX_ESCORT_DESC_RECORD_NUM = 200,
    MAX_ESCORT_ID_VALUE = 200,
    MAX_ESCORT_LEVEL_DESC_RECORD_NUM = 100,
    MAX_ESCORT_WORLD_ID_VALUE = 100,
    MAX_COUNTER_REFRESH_DESC_NUM = 50,
    MAX_ACTIVITY_COUNT_DESC_NUM = 1000,
    MAX_ACTIVITY_QUEST_DESC_NUM = 100,
    MAX_ACTIVITY_EIGHT_COUNT_DESC_NUM = 500,
    MAX_GUILD_QUSTION_COUNT_DESC_NUM = 500,
    MAX_GUILD_REBATE_COUNT_DESC_NUM = 20,
    MAX_GUILD_REBATE_AWARDS_COUNT_DESC_NUM = 10,
    MAX_GUILD_REBATE_CALCULATE_COUNT_DESC_NUM = 30,
    MAX_GUILD_JOB_RIGHTS_COUNT_DESC_NUM = 15,
    MAX_INTEGRAL_EXCHANGE_COUNT_DESC_NUM = 20,
    MAX_ACTIVITY_REWARD_DESC_NUM = 10,
    MAX_NPC_SPAWN_ID_VALUE = 5000,
    MAX_NPC_SPAWN_RECORD_NUM = 1000,
    MAX_NPC_LOCATION_ID_VALUE = 5000,
    MAX_NPC_LOCATION_RECORD_NUM = 5000,
    MAX_NPC_GROUP_ID = 500,
    MAX_NPC_GROUP_RECORD_NUM = 50,
    MAX_NPC_NUM_PER_GROUP = 50,
    MAX_LIFE_SKILL_DESC_RECORD_NUM = 3000,
    MAX_HUNTER_JOB_DESC_RECORD_NUM = 50,
    MAX_LIFE_SKILL_DESC_ID_VALUE = 4000,
    MAX_LIFE_SKILL_LEVEL = 200,
    MAX_MAKE_DRUG_DESC_RECORD_NUM = 800,
    MAX_MAKE_DRUG_DESC_ID_VALUE = 1000,
    MIN_MAKE_USE_GRUG_NUM = 2,
    MAX_MAKE_USE_DRUG_NUM = 4,
    MAX_TREASUREMAPPOSITION_DESC_RECORD_NUM = 1000,
    MAX_TREASUREMAPPROBABILITY_DESC_RECORD_NUM = 100,
    MAX_TREASUREMAPSILVER_DESC_RECORD_NUM = 100,
    MAX_TREASUREMAPTREASURE_DESC_RECORD_NUM = 2000,
    MAX_TREASUREMAPCOPY_DESC_RECORD_NUM = 1000,

    MAX_MQCRANDOM_DESC_RECORD_NUM = 200,
    MAX_MQCRANDOM_DESC_ID = 200,
    MAX_MQCNPCPOOL_DESC_RECORD_NUM = 200,
    MAX_MQCITEMPOOL_DESC_RECORD_NUM = 200,
    MAX_MQCITEMTYPEPOOL_DESC_RECORD_NUM = 200,
    MAX_MQCBATTLEPOOL_DESC_RECORD_NUM = 200,

    MAX_PLAYER_JOB_NUM = 6,
    MAX_SKILL_AWAKE_DESC_RECORD_NUM = 100,
    MAX_PLAYER_AWAKE_NUM = 5,
    MAX_AWAKE_BRACH_RECORD_NUM = 100,
    MAX_AWAKE_BRACH_ID_NUM = 1000,

    MAX_NPC_ID_RECORD_NUM = 10000,

    MAX_REAWAKE_COST_RECORD_NUM = 20,
    MAX_SKILL_ORDER_NUM = 100,
    MAX_SKILL_UPGRADE_RECORD_NUM = 2000,

    MAX_GEMSTONE_CATEGORY = 100,
    MAX_BOX_BEHAVIOR_NUM = 50,
    MAX_ITEM_EXCHANGE_ID_VALUE = 10000,
    MAX_ITEM_EXCHANGE_DESC_RECORD_NUM = 1024,

    MAX_BATTLE_TYPE_RECORD_NUM = 60,
    MAX_BATTLELIMIT_DESC_RECORD_NUM = 50,

    MAX_BATTLE_TYPE_ID = 100,
    MAX_AWARD_MUTEX_ID = 128,

    MAX_SERVER_LEVEL_DESC_ID_VALUE = 600,
    MAX_SERVER_LEVEL_DESC_RECORD_NUM = 300,
    MAX_DRUG_EFFECT_DESC_NUM = 200,

    MAX_GOODS_TRANSPORT_DATA_NUM = 200,
    MAX_GOODS_TRANSPORT_POS_NUM = 8,
    MAX_GOODS_TRANSPORT_AWARDS_DATA_NUM = 50,

    MAX_ACTIVITY_WELFARE_EXP_COUNT = 20,
    MAX_ACTIVITY_WELFARE_EXP_PARAM_NUM = 100,

    MAX_ITEM_DESC_RECORD_NUM = 16384,

    MAX_NAME_LEN = 32,
    MAX_MALL_TYPE = 10,

    MAX_ACTTRAPTOWER_DESC_NUM = 100,
    MAX_ACTIVITY_REWARD_NEW_DESC_ID_VALUE = 200,
    MAX_ACTIVITY_REWARD_NEW_DESC_RECORD_NUM = 100,
    MAX_ACTIVITY_SIX_EXPERIMENT_RANK_NUM = 11,
    MAX_ACTIVITY_SIX_EXPERIMENT_SCORE_NUM = 4,
    MAX_ACTIVITY_SIX_EXPERIMENT_ROUND_NUM = 7,

    MAX_QUEST_DESC_RECORD_NUM = 32768, //32 * 1024, // 任务表任务数量


    MAX_ACHIEVE_ID_VALUE = 8192, // 必须能被8整除(bitmap)
    MAX_ACHIEVE_REWARD_ID_VALUE = 512, // 必须能被8整除(bitmap)
    MAX_INTRUST_QUEST_NUM = 256,

    MAX_TRAPTOWER_FLOOR_VALUE = 9,
    MAX_CHAMBER_LABEL = 100,
    MAX_CHAMBER_SUB_LABEL = 1000,

    MAX_MARKET_SUB_LABEL = 100,
    MAX_MARKET_DESC_NUM = 500,
    MAX_MARKET_GOODS_NUM = 2000,
    MAX_MARKET_GOODS_LIST_ID = 100000,
    MAX_MARKET_INDEX_NUM = 500,
    MAX_MARKET_INDEX_ID = 1000,
    MAX_MARKET_DESC_ID = 100000,
    MAX_ACTIVITY_SEA_DISCOVERY_RANK_NUM = 10,
    MAX_ACTIVITY_SEA_DISCOVERY_SCORE_NUM = 10,

    MAX_RUIN_GOLD_DESC_NUM = 15,

    MAX_BOX_LUCKY_DESC_NUM = 100,
    MAX_BOX_LIBRARY_DESC_NUM = 100,
    MAX_BOX_LIBRARY_ID = 100,
    MAX_BOX_EXCHANGE_DESC_NUM = 10,

    MAX_PROJECTILE_PROTOTYPE_ID_VALUE = 1000,

    MAX_ACTIVITY_ENTER_CONDITION_ID_VALUE = 60,
    MAX_ACTIVITY_ENTER_CONDITION_DESC_NUM = 30,
    MAX_ATHLETICS_AWARDS_ID_VALUD = 200,
    MAX_ATHLETICS_AWARDS_DESC_NUM = 100,

    MAX_CREDIT_CONTROL_ID_VALUE = 200,
    MAX_CREDIT_CONTROL_DESC_NUM = 150,

    MAX_TITLE_DESC_NUM = 1000,
    MAX_TITLE_MAX_ID = 2001,

    MAX_FASHION_MALL_DESC_NUM = 3000,

    MAX_FASHION_SET_ID_VALUE = 10000,
    MAX_FASHION_SET_DESC_NUM = 200,

    MAX_MASTER_EXERCISE_DESC_NUM = 10,
    MAX_MASTER_EXERCISELIB_DESC_NUM = 200,
    MAX_MASTER_MILESTONE_DESC_NUM = 30,
    MAX_MASTER_SCORE_DESC_NUM = 20,

    MAX_PARTNER_BATTLE_RANK_ID_VALUE = 100,
    MAX_PARTNER_BATTLE_RANK_DESC_NUM = 100,

    MAX_PARTNER_BATTLE_RANK_AWARDS_ID_VALUE = 100,
    MAX_PARTNER_BATTLE_RANK_AWARDS_DESC_NUM = 100,

    MAX_PARTNER_BATTLE_SEASON_ID_VALUE = 50,
    MAX_PARTNER_BATTLE_SEASON_DESC_NUM = 50,

    MAX_PARTNER_BATTLE_SUSPENSION_ID_VALUE = 50,
    MAX_PARTNER_BATTLE_SUSPENSION_DESC_NUM = 50,

    MAX_LICENSE_DESC_NUM = 20,
    MAX_LICENSE_BLOCK_NUM = 200,
    MAX_LICENSE_BLOCK_ID = 10000,
    MAX_LICENSE_LP_EXCHANGE_NUM = 2000,
    MAX_LICENSE_LP_LIMIT_NUM = 100,
    MAX_LICENSE_SLOT_NUM = 20,

    MAX_EXMOVE_DESC_NUM = 100,
    MAX_EXMOVE_ID = 1000,

    MAX_PARTNER_RANK_UP_NEW_ID_VALUE = 1000,
    MAX_PARTNER_RANK_UP_NEW_DESC_NUM = 200,
    MAX_PARTNER_RANK = 10,


    MAX_CREDIT_MARKET_ID_VALUE = 100,
    MAX_CREDIT_MARKET_DESC_NUM = 100,

    MAX_GUILD_BATTLE_SIGN_UP_ID_VALUD = 10,
    MAX_GUILD_BATTLE_SIGH_UP_DESC_NUM = 10,

    MAX_CHAT_MSG_ID_VALUE = 1000,
    MAX_CHAT_MSG_DESC_NUM = 500,

    MAX_PARTNER_SKIN_ID_VALUE = 10000,
    MAX_PARTNER_SKIN_DESC_NUM = 1000,

    MAX_DUNGEON_DATA_ID_VALUE = 10000,
    MAX_DUNGEON_DATA_DESC_NUM = 1000,

    MAX_DUNGEON_EVENT_ID_VALUE = 10000,
    MAX_DUNGEON_EVENT_DESC_NUM = 1000,

    MAX_DUNGEON_REFRESH_ID_VALUE = 1000,
    MAX_DUNGEON_REFRESH_DESC_NUM = 100,

    MAX_DUNGEON_AWARDS_ID_VALUE = 10,
    MAX_DUNGEON_AWARDS_DESC_NUM = 10,

    MAX_LEVEL_DATA_CORRECT_ID_VALUE = 151,
    MAX_LEVEL_DATA_CORRECT_DESC_NUM = 151,

    MAX_MULTI_LEVEL_DATA_ID_VALUE = MAX_MAP_DESC_ID_VALUE,
    MAX_MULTI_LEVEL_DATA_DESC_NUM = 1000,

    MAX_PARTNER_COLLECTION_VAR_ID_VALUE = 500,
    MAX_PARTNER_COLLECTION_VAR_DESC_NUM = 500,

    MAX_ACT_BOUNTY_ID_VALUE = 100,
    MAX_ACT_BOUNTY_DESC_NUM = 30,

    MAX_ACT_BOUNTY_TARGET_ID_VALUE = 10,
    MAX_ACT_BOUNTY_TARGET_DESC_NUM = 10,

    MAX_PARTNER_ASSISTANCE_SKILL_ID_VALUE = 1000,
    MAX_PARTNER_ASSISTANCE_SKILL_DESC_NUM = 1000,
    MAX_PARTNER_HAND_SKILL_LEVEL = 40,

    MAX_MAP_PER_BATTLE = 10,

    MAX_INSTANCE_DESC_NUM = 200,
    MAX_INSTANCE_DESC_ID_VALUE = 1000,

    MAX_LEVEL_LINK_DESC_NUM = 500,
    MAX_LEVEL_LINK_ID_VALUE = 10000,

    MAX_PARTNER_TREASURE_DESC_NUM = 500,

    MAX_PARTNER_TREASURE_VALUE_DESC_NUM = 10,
    MAX_PARTNER_TREASURE_VALUE_ID_VALUE = 10,

    MAX_PARTNER_TREASURE_COMPOSE_SKILL_NUM_DESC_NUM = 10,
    MAX_PARTNER_TREASURE_COMPOSE_SKILL_NUM_ID_VALUE = 20,

    MAX_PARTNER_TREASURE_COMPOSE_RANDOM_SKILL_NUM_DESC_NUM = 30,
    MAX_PARTNER_TREASURE_COMPOSE_RANDOM_SKILL_NUM_ID_VALUE = 50,

    MAX_PARTNER_TREASURE_LEVEL_DESC_NUM = 500,

    MAX_PARTNER_TREASURE_ATTR_DESC_NUM = 100,
    MAX_PARTNER_TREASURE_ATTR_ID_VALUE = 200,

    MAX_PARTNER_TREASURE_SCORE_DESC_NUM = 10,
    MAX_PARTNER_TREASURE_SCORE_ID_VALUE = 10,

    MAX_SIGN_IN_MONTHLY_DESC_ID_VALUE = 40,

    MAX_FAIR_COMPETITION_DESC_NUM = 100,
    MAX_FAIR_COMPETITION_ID_VALUE = 200,

    MAX_PORTAL_DESC_NUM = 200,
    MAX_PORTAL_ID_VALUE = 3000,

    MAX_INSTANCE_CHALLENGE_DESC_NUM = 1000,
    MAX_INSTANCE_CHALLENGE_ID_VALUE = 10000,

    MAX_LEVEL_RUSH_CHAPTER_DESC_NUM = 50,
    MAX_LEVEL_RUSH_CHAPTER_ID_VALUE = 100,

    MAX_LEVEL_RUSH_STAGE_DESC_NUM = 1000,
    MAX_LEVEL_RUSH_STAGE_ID_VALUE = 10000,

    MAX_LEVEL_RUSH_REWARD_DESC_NUM = 50,
    MAX_LEVEL_RUSH_REWARD_ID_VALUE = 100,

    MAX_LEVEL_RUSH_DIFFICULTY = 4,
    MAX_LEVEL_RUSH_CHAPTER_REWARD_NUM = 10,
    MAX_LEVEL_RUSH_CHAPTER_STAGE_NUM = 20,

    MAX_PLAYER_CE_DESC_NUM = 20,
    MAX_PLAYER_CE_ID_VALUE = 20,

    MAX_PLAYER_CE_REWARD_DESC_NUM = 500,
    MAX_PLAYER_CE_REWARD_ID_VALUE = 1000,

    MAX_AUTO_RECOVER_DESC_NUM = 50,
    MAX_AUTO_RECOVER_ID_VALUE = 100,

    MAX_RISING_PURCHASE_DESC_NUM = 100,
    MAX_RISING_PURCHASE_ID_VALUE = 200,

    MAX_LEVEL_BLESS_DESC_NUM = 20,
    MAX_LEVEL_BLESS_ID_VALUE = 50,

    MAX_ABYSS_DESC_NUM = 300,
    MAX_ABYSS_ID_VALUE = 1000,

    MAX_FIGHT_AI_DESC_NUM = MAX_ACTOR_DESC_NUM,
    MAX_FIGHT_AI_ID_VALUE = 5000000,

    MAX_MONSTER_RESISTANCE_DESC_NUM = 1024,
    MAX_MONSTER_RESISTANCE_ID_VALUE = 1024,

    MAX_SKILL_IDX_ID_VALUE = 500,

    MAX_MODIFY_SPAWN_DESC_NUM = 1024,
    MAX_MODIFY_SPAWN_ID_VALUE = 10000,

    MAX_RECRUIT_DESC_NUM = 20,
    MAX_RECRUIT_ID_VALUE = 100,

    MAX_INFINITE_DUNGEON_MAP_GENE_DESC_NUM = 10,

    MAX_INFINITE_DUNGEON_MAP_ROW_NUM = 5,
    MAX_INFINITE_DUNGEON_MAP_COL_NUM = 10,

    MAX_INFINITE_DUNGEON_EVENT_DESC_NUM = 200,
    MAX_INFINITE_DUNGEON_EVENT_ID_VALUE = 10000,

    MAX_INFINITE_DUNGEON_MARKET_DESC_NUM = 100,
    MAX_INFINITE_DUNGEON_MARKET_ID_VALUE = 10000,

    MAX_INFINITE_DUNGEON_BUFF_DESC_NUM = 200,
    MAX_INFINITE_DUNGEON_BUFF_ID_VALUE = 10000,

    MAX_INFINITE_DUNGEON_TREASURE_DESC_NUM = 200,
    MAX_INFINITE_DUNGEON_TREASURE_ID_VALUE = 10000,

    MAX_INFINITE_DUNGEON_PARTNER_DESC_NUM = 10,
    MAX_PARTNER_QUALITY = 10,

    MAX_INFINITE_DUNGEON_GOODS_DESC_NUM = 200,
    MAX_INFINITE_DUNGEON_GOODS_ID_VALUE = 10000,

    MAX_INFINITE_DUNGEON_MAP_IDX = 40,
    MAX_INFINITE_DUNGEON_MAP_STEP_PER_MAP_STEP = 10,
    MAX_INFINITE_DUNGEON_MAP_STEP = MAX_INFINITE_DUNGEON_MAP_IDX * MAX_INFINITE_DUNGEON_MAP_STEP_PER_MAP_STEP,
    MAX_INFINITE_DUNGEON_BATTLE_TYPE = 3,

    MAX_EXPLORER_DATA_DESC_NUM = 30,
    MAX_EXPLORER_DATA_ID_VALUE = 30,
    MAX_EXPEDITION_DATA_DESC_NUM = 20,
    MAX_EXPEDITION_DATA_ID_VALUE = 20,
    MAX_EXPEDITION_CONDITION_DESC_NUM = 1000,
    MAX_EXPEDITION_CONDITION_ID_VALUE = 1000,
    MAX_EXPEDITION_CONDITION_GROUP = 20,
    MAX_EXPEDITION_CONDITION_GROUP_NUM = 50,
    MAX_EXPLORER_QUEST_DESC_NUM = 30,
    MAX_EXPLORER_QUEST_ID_VALUE = 30,

    MAX_PARTNER_EQUIP_DESC_RECORD_NUM = 16384,
    MAX_PARTNER_EQUIP_STAR_DESC_RECORD_NUM = 100,
    MAX_PARTNER_EQUIP_TYPE = 10,
    MAX_PARTNER_EQUIP_STONE_DESC_RECORD_NUM = 16384,
    MAX_PARTNER_EQUIP_STONE_SLOT_DESC_RECORD_NUM = 100,
    MAX_PARTNER_EQUIP_STONE_COMPOSE_DESC_RECORD_NUM = 100,
    MAX_PARTNER_EQUIP_DECOMPOSE_DESC_RECORD_NUM = 100,

    MAX_LEVEL_GROUP_DUNGEON_DESC_NUM = 1000,
    MAX_LEVEL_GROUP_DUNGEON_ID_VALUE = 100000,

    MAX_WORLD_BOSS_DESC_NUM = 100,
    MAX_WORLD_BOSS_ID_VALUE = 1000,

    MAX_WORLD_BOSS_REWARD_DESC_NUM = 200,
    MAX_WORLD_BOSS_REWARD_ID_VALUE = 1000,
    MAX_WORLD_BOSS_RANK = 10000,

    MAX_RAID_DESC_NUM = 100,
    MAX_RAID_ID_VALUE = 100,
    MAX_RAID_STAGE_DESC_NUM = 100,
    MAX_RAID_STAGE_ID_VALUE = 1000,
    MAX_RAID_LEVEL_DESC_NUM = 100,
    MAX_RAID_LEVEL_ID_VALUE = 10000,
    MAX_RAID_BUFF_DESC_NUM = 100,
    MAX_RAID_BUFF_ID_VALUE = 100,
    MAX_TREASURE_HUNT_DESC_NUM = 2500,
    MAX_ROULETTE_CONST_DESC_NUM = 10,
    MAX_TREASURE_HUNT_ASSIGNMENT_DESC_NUM = 10,
    MAX_EQUIP_POINT_DESC_NUM = 100,
    MAX_EQUIP_POINT_ID_VALUE = 100,
    MAX_EQUIP_POINT_REWARD_DESC_NUM = 12,
    MAX_EQUIP_POINT_REWARD_ID_VALUE = 12,
};

/* GET_PLAYER_TYPE*/
enum TagGetPlayerType
{
    GET_PLAYER_ONLINE = 0, /* 只返回在线玩家 */
    GET_PLAYER_ANY = 1, /* 返回任何状态的玩家 */
};

inline bool IS_RAW_VALUE_ATTR(int eAttr)
{
    return eAttr == proto_ff::EN_ATTR_MAX_HP || eAttr == proto_ff::EN_ATTR_EXP_SUM || eAttr == proto_ff::EN_ATTR_HP || eAttr == proto_ff::EN_ATTR_CUR_MAX_HP || eAttr == proto_ff::EN_ATTR_MP || eAttr == proto_ff::EN_ATTR_MAX_MP || eAttr == proto_ff::EN_ATTR_CE || eAttr == proto_ff::EN_ATTR_HP_RESERVE || eAttr == proto_ff::EN_ATTR_MP_RESERVE || eAttr == proto_ff::EN_ATTR_CE_NEW;
}

inline bool IS_VALID_ATTR(int attr)
{
    return attr > 0 && attr < proto_ff::AttrType_ARRAYSIZE;
}
